/**
 * Copyright &copy; 2012-2016 <a href="http://m.gxwin.cn">gxkj</a> All rights reserved.
 */
package com.andnux.android.utils;

import java.security.SecureRandom;
import java.util.UUID;

public class IdGen {

    private static final SecureRandom random = new SecureRandom();

    /**
     * 封装JDK自带的UUID, 通过Random数字生成, 中间无-分割.
     */
    public static String UUID() {
        return UUID.randomUUID().toString().replaceAll("-", "");
    }

    /**
     * 使用SecureRandom随机生成Long.
     */
    public static long randomLong() {
        return Math.abs(random.nextLong());
    }
}
